#include <xp/bas/stdio.h>
#include <xp/bas/sysapi.h>

int xp_main (int argc, xp_char_t* argv[])
{
	xp_char_t buf[XP_PATH_MAX + 1];

	if (argc != 2) {
		xp_printf (XP_TEXT("usage: %s link_file\n"), argv[0]);
		return -1;
	}

	if (xp_readlink (argv[1], buf, xp_countof(buf)) == -1) {
		xp_printf (XP_TEXT("cannot read link %s\n"), argv[1]);
		return -1;
	}

	xp_printf (XP_TEXT("%s ==> [%s]\n"), argv[1], buf);
	return 0;
}

